home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / ip / ppp / dp-2.3 / doc / DialupPPP next >
Encoding:
Text File  |  1993-01-27  |  74.5 KB  |  1,892 lines

  1.                 Dialup PPP
  2.                 Release 2.3
  3.                 Kirk Smith
  4.                 Purdue University
  5.                 January 1993
  6.  
  7. 1.  Introduction
  8.  
  9. 1.1 General
  10.  
  11. This software was developed to provide dialup on demand PPP over high
  12. speed modems.  In many situations, leased lines are used to provide
  13. TCP/IP links over significant distances.  With the advent of V.32bis
  14. modems, and with this software, another alternative exists.  It
  15. appears to the application that the modems remain connected all the
  16. time (like a leased line). In reality, however, they disconnect
  17. whenever there is no traffic. When a packet arrives at the interface
  18. to be transmitted, and the modems are not connected, a connection is
  19. made and the packets begin to flow again.
  20.  
  21. 1.2 Audience
  22.  
  23. This file contains information for those intending to install and use
  24. dp (Dialup PPP), and is not aimed at teaching you about TCP/IP networking,
  25. although subjects which may be new to you such as routing and nameservers
  26. will be covered.
  27.  
  28. 1.3 History
  29.  
  30. The base for this software is several other free packages that have
  31. been modified to support this purpose.  The dialup code came from the
  32. BBN Dialup Slip.  The PPP program is from Carnegie Mellon University. The
  33. kernel PPP streams driver came from Brad K. Clements. The TCP/IP
  34. header compression support came from Van Jacobson from the University
  35. of California.  Kirk Smith at Purdue University assembled all these
  36. pieces, made them all work together, and added a number of features
  37. beyond the original software.
  38.  
  39. 1.4 Release Notes
  40.  
  41. 1.4.1 Supported Platforms
  42.  
  43. The software has been running on SunOS 4.1.1 and 4.1.2 and works quite well.
  44. It will probably not work on anything but SunOS4 (Solaris 1.0). It
  45. relies on STREAMS support.  It is possible to make it work in a
  46. non-streams environment, but this has not done that. The latest
  47. version of the PPP (non-dial on demand) has support for 386BSD, and
  48. this platform may be supported soon.
  49.  
  50. 1.5 Commercial Software
  51.  
  52. Companies sell products that do things similar to this.  I believe
  53. that this software incorporates some unique features and has value in
  54. itself. However, if you want a supported product, you might want to
  55. shop around. Morning Star Technologies is one company that I know of.
  56. Try sending mail to marketing@morningstar.com for more information. 
  57. From what I can tell, they have a top notch product and top notch
  58. support.
  59.  
  60. A mailing list "dplist@phoenix.acn.purdue.edu" is available.  To
  61. subscribe to this list, send a message to
  62. "dplist-request@phoenix.acn.purdue.edu". This list is a group of
  63. people either using or thinking about using this software.
  64.  
  65. 2. Operational Overview
  66.  
  67. The software known as Dialup PPP (or dp-2.3) consists of several
  68. distinct modules.  This section will discuss how the modules fit
  69. together and then will describe each module in more detail.
  70.  
  71. From the application standpoint, this software implements a network
  72. interface.  Ethernet interfaces have names like ie0, le0, or le1,
  73. etc. This interface has a name like dp0, dp1, dp2, etc.  While
  74. ethernets are "Broadcast" networks, these is a "Point to Point"
  75. networks.  This is important to consider when dealing with address
  76. assignment and routing. In short, when you "ifconfig" a point to
  77. point interface, you must provide an IP address for both the source
  78. and destination.  Routes to the network never exist, but routes to
  79. both ends of the interface may exist. For more information on this,
  80. refer to the manual pages on ifconfig(8c), route(8c), and routed(8c).
  81.  
  82. This network is always "UP" from the perspective of "ifconfig". Under
  83. normal conditions, network applications like "telnet" or "ftp" will
  84. always see a network that is up, even if there is a slight delay
  85. while modems are re-connected.
  86.  
  87. 2.1 File Location Configuration
  88.  
  89. Earlier versions of Dialup PPP placed files in very specific places.
  90. dp-2.3 allows flexible placement of files.  The only really fixed
  91. file is /etc/dp.conf.  It basically contains a list of pathnames
  92. for standard things.  It looks like this:
  93.  
  94.     #
  95.     # Config file for Dialup PPP.
  96.     #
  97.     # This file specifies the paths where all the related PPP files and
  98.     # programs are located.
  99.     #
  100.     DPCONF_DIR=/etc/dp         # System Specific Files
  101.     DPLOG_DIR=/var/adm/dp         # Log Files and Other Writeable Files
  102.     DPPID_DIR=${DPLOG_DIR}/Pid     # Files for Process IDs
  103.     DPTRACE_DIR=${DPLOG_DIR}/Trace     # Trace Files
  104.     DPROTARY_DIR=${DPLOG_DIR}/Rotary # Rotary Files
  105.     DP_DIR=/usr/dp             # Common Files for All Systems
  106.     DPBIN_DIR=${DP_DIR}/bin         # Programs
  107.     DPSCRIPT_DIR=${DP_DIR}/script     # Standard Dialing Scripts
  108.     DPACCESS_DIR=${DP_DIR}/access     # Standard Access Files
  109.     DPAUX_DIR=${DP_DIR}/aux         # Auxilliary Programs
  110.     DPMODEM_DIR=${DP_DIR}/modem     # Modem Support Programs
  111.     DPMODULE_DIR=${DP_DIR}/modules     # Kernel Modules
  112.  
  113. The DPCONF_DIR typically contains files that are specific to a given
  114. system.  The "${DPCONF_DIR}/conf" file contains the bulk of the interface
  115. configuration.  In addition, script and access files specific to a
  116. single system can be placed in this directory.
  117.  
  118. The DPLOG_DIR contains log files and files that get written frequently.
  119. It has a few subdirectories that contain files that store current status.
  120.  
  121. The other directories should be relatively static from one machine
  122. to the next.  The default configuration file groups them all under ${DP_DIR}.
  123. This can be changed to suit local needs. 
  124.  
  125. In the remainder of this document, we will refer to directories by their
  126. symbolic name such as ${DPXXX_DIR} since the location will typically
  127. vary from system to system.
  128.  
  129. 2.2 Normal Operation
  130.  
  131. If the modems are connected, this network interface looks like a
  132. dedicated leased line Point to Point interface.  Packets flow from
  133. the kernel networking software to the appropriate "dp" interface. 
  134. The kernel driver for that interface consists primarily of the "dpif"
  135. streams module.  The packets then become streams messages and are
  136. passed to the "pppasync" module. This module encapsulates the packets
  137. according to the PPP specification, including the addition of a frame
  138. check sum.  It then passes the packets on to the streams driver of
  139. the particular serial port hardware.  The serial hardware passes the
  140. byte stream onto the modem and out into the public telephone system.
  141.  
  142. In addition, packets can be sent from the user level PPP program
  143. (called dp). These packets are sent through the "dpif" streams module
  144. and on to the "pppasync" module where they are encapsulated,
  145. checksummed, and passed to the serial port streams hardware to the
  146. modem.
  147.  
  148. On the other end, incoming bytes are received by the serial port
  149. streams driver and passed on to the "pppasync" streams module.  This
  150. module collects the bytes together into packets and rejects packets
  151. with bad checksums according to the PPP specification.  Then, packets
  152. are passed on to the "dpif" streams module where they are identified
  153. as being either IP packets or control packets.  IP packets are passed
  154. through the "dp" interface to the kernel TCP/IP modules.  PPP control
  155. packets are passed off to a user level PPP process for further
  156. interpretation.
  157.  
  158. This series of modules basically multiplexes and demultiplexes
  159. packets from the PPP programs and the kernel networking on both ends.
  160.  
  161. 2.3 Establishing Modem Connections
  162.  
  163. Assume, for now, that the network is properly configured, and the
  164. modems are not currently connected.  When packets arrive at the
  165. interface to be transmitted to the other end, there is no "dpif"
  166. stream associated with the interface. There is no specific serial
  167. port associated with the network interface at this time.  This
  168. corresponds to the DISCON (disconnected) state.  The packet is placed
  169. in a network queue awaiting a successful connection.
  170.  
  171. A request is assembled for this packet.  The request is a separate
  172. streams message which includes the interface name, the interface unit
  173. number, a flag indicating to check authorization, the destination
  174. address, a copy of the IP header and the next 4 bytes of the packet. 
  175. In both TCP and UDP, these next 4 bytes indicate source and
  176. destination ports. This request is sent to a user level program
  177. called "dpd" (Dialup PPP Daemon) through another streams device
  178. accessed through "/dev/dp0". If "dpd" is not running or not accepting
  179. messages on "/dev/dp0", then the networking code immediately returns
  180. ENETDOWN (network down). Otherwise, the WAITING state is entered and
  181. packets continue to be queued until the call completes.
  182.  
  183. When the "dpd" program is started, it reads the configuration file
  184. "${DPCONF_DIR}/conf".  This contains information about each
  185. network interface and each available modem.  So, when the request
  186. arrives, the "dpd" program checks for authorization according to
  187. the interface configuration.  If a call is not permitted, a FAILURE
  188. status is returned to the network interface.  Otherwise, dpd reports
  189. a CALL_IN_PROGRESS status and creates a child process to handle this
  190. call.
  191.  
  192. An appropriate modem is selected according to the configuration (this
  193. will be explained in more detail later), and the call is placed using
  194. the appropriate dial script.  Once the call completes, the
  195. appropriate login script is used to log into the remote computer.  A
  196. special account is set up on the remote computer that uses the login
  197. shell "${DPBIN_DIR}/dplogin". This program reads the configuration in
  198. "${DPCONF_DIR}/conf", performs simple synchronization with the
  199. "dpd" at the other end and sets the call status to CALL_IN_PROGRESS.
  200.  
  201. Both the "dpd" and "dplogin" programs start the "${DPBIN_DIR}/dp" program
  202. on both ends.  They negotiate all the options according to their own
  203. configuration. Once they have completed their negotiations, they
  204. report the SUCCESS call status and mark the network interfaces as
  205. ACTIVE.
  206.  
  207. If a call FAILURE status is reported, or a call wait timeout expires,
  208. the interface is marked with FAILEDCALL status.  After an appropriate
  209. timeout, the interface moves back to a DISCON status.  This enforces
  210. a minimum time between call attempts.  However, if the call failed
  211. because no modem was available, dpd reports a special NO_MODEM status
  212. which is similar to FAILURE status except the interface immediately
  213. moves to the DISCON status so that further call attempts can be made.
  214.  
  215. 2.4 Timing Out Modem Connections
  216.  
  217. Several timeouts can be specified in the configuration file
  218. "${DPCONF_DIR}/dp-conf".  Among those are the timeouts which govern
  219. when the modems should be disconnected.  These timeouts are handled
  220. by the kernel "dpif" module.  When the kernel decides to disconnect a
  221. given interface, it sends a hangup signal (SIGHUP) to the "dp"
  222. process which shuts down the link.  The operation of each timer will
  223. be described. Each timeout is given in seconds and is specified in
  224. the configuration file. We have found that this particular
  225. combination of timers is highly effective in our typical use.  It
  226. allows reasonable timeouts for interactive use, while quickly timing
  227. out calls that were made for batch operations.
  228.  
  229. 2.4.1 Inactivity Timer
  230.  
  231. The simplest timeout mechanism is the inactivity timeout.  If no
  232. packets have been sent or received within a given time interval, then
  233. the modems are disconnected.  This is usually relatively long,
  234. roughly on the order of 2 to 3 minutes.
  235.  
  236. 2.4.2 TCP Close Timer
  237.  
  238. The kernel keeps track of TCP/IP connections.  Each TCP/IP connection
  239. is characterized by a distinct source and destination address and
  240. port. During the life of a TCP/IP connection, packets are exchanged
  241. with certain bits set in the header to indicate the creation and
  242. deletion of these logical connections.  The interesting parts of the
  243. header are the SYN, FIN, and RST bits.  The software monitors the
  244. TCP/IP connections in progress.  By noting the passage of SYN, FIN,
  245. and RST bits in TCP/IP headers, we keep a count of the number of
  246. active TCP/IP connections. When that connection count goes to zero,
  247. we assume that everyone has finished using the network interface for
  248. now, and a fast timeout is enabled. This shorter timeout will
  249. disconnect the modems if no packets are sent or received over an
  250. interval shorter than the normal inactivity timeouts. We have set
  251. this interval as small as 5 seconds and it works quite well
  252.  
  253. 2.4.3 Non TCP Timer
  254.  
  255. Not every network application uses TCP, so consideration is made for
  256. that case. In the case of no TCP connections, but non-TCP traffic is
  257. flowing, a separate inactivity timeout can be specified.  This is
  258. usually on the same order as the TCP Close timer, but perhaps a
  259. little longer depending on the applications in use.
  260.  
  261. 3. Source Code Overview
  262.  
  263. 3.1 "conf" directory
  264.  
  265. This directory contains the /etc/dp.conf file and related files.
  266. Before running make install, the dp.conf file should be edited as
  267. appropriate for your system.
  268.  
  269. This directory also contains examples of ${DPCONF_DIR}/conf.  "conf.hub"
  270. is an example of a central machine with several dp interfaces and
  271. a few modems.  "conf.leaf" is an example of a machine with one dp interface
  272. and one modem.
  273.  
  274. 3.2 "h" directory
  275.  
  276. This directory contains include files that are used by several of the
  277. programs that comprise this distribution.  The files dp_str.h,
  278. if_ppp.h, ppp_str.h, slcompress.h, and slip_var.h need to be copied to
  279. /usr/sys/sys as part of the kernel build procedure.
  280.  
  281. 3.3 "dp" directory
  282.  
  283. This directory contains a slightly modified version of the CMU PPP
  284. code. In release 2.0, it was based on "ppp" patch level 4, but under
  285. release 2.3, it is based on "ppp" patch level 6.
  286.  
  287. The modifications to the standard PPP are small, but are necessary
  288. for this mode of operation.  The "dp" program takes all the flags
  289. that apply to the "ppp" program.  In addition, if the "dialup" flag
  290. is given to dp, it modifies the behavior in the following ways:
  291.  
  292. - The name of the network interface is dp0, dp1, etc., instead of
  293. ppp0, ppp1, etc.
  294.  
  295. - When an interface is brought up, it executes a SIOCCALLSTAT ioctl
  296. which is specific to the dialup PPP software.
  297.  
  298. - When a normal PPP interface is brought down, it marks the network
  299. interface as DOWN and removes the appropriate route.  For dialup PPP
  300. interfaces, however, the interface always appears to be UP and the
  301. route remains installed.
  302.  
  303. 3.4 "dpd" directory
  304.  
  305. This is originally based on the diald program from BBN.  It has been
  306. heavily modified to handle PPP rather than slip, and to handle the
  307. different kernel interfaces.  This section will describe the major
  308. differences in functionality.
  309.  
  310. The BBN code had a good expect script capability for doing the
  311. dialing. This capability has been expanded somewhat to allow better
  312. error handling. The "recv" directive has been modified to accept any
  313. number of alternative strings.  One use this to accept all known
  314. return codes from the modem. In addition, the timeout value on the
  315. "recv" can now take on a value of 0. This means to only receive input
  316. that has been already received when the "recv" is executed.  Use of a
  317. "replay" followed by a "recv "string" 0" will immediately either succeed
  318. or fail based on input received since the last "mark". An example of this
  319. is the following:
  320.  
  321.     mark
  322.     {
  323.     alternate
  324.         recv "CONNECT" "BUSY" "NO CARRIER" 30
  325.     alternate
  326.         log "Modem Timeout"
  327.         abort
  328.     }
  329.     {
  330.     alternate
  331.         replay
  332.         recv "CONNECT" 0
  333.         go
  334.     alternate
  335.         replay
  336.         recv "BUSY" 0
  337.         log "Busy"
  338.         abort
  339.     alternate
  340.         replay
  341.         recv "NO CARRIER" 0
  342.         log "No Carrier"
  343.         abort
  344.     }
  345.  
  346. This segment of a script will wait up to 30 seconds to accept either
  347. "CONNECT", "BUSY", or "NO CARRIER", then immediately do the correct
  348. branch.  This was impossible to handle in a timely way using the
  349. original code.
  350.  
  351. The connection requests sent from the kernel to the "dpd" program can
  352. include more than the IP header.  This was done to accommodate any
  353. future enhancements that would screen connection requests based on
  354. TCP or UDP port numbers.
  355.  
  356. The uucp locking conventions have been updated to match those in use
  357. by the Sun version of uucp.  This is important to allow several
  358. programs to share the available modems with the kernel networking.
  359.  
  360. A new flexible configuration file allows setting of many new options.
  361. There will be section devoted to this configuration file which will
  362. describe the options in detail.
  363.  
  364. The timeout mechanisms have been expanded.  A "call wait" timeout is
  365. supported for the maximum waiting period between a call request and
  366. the completion of the call.  Once a call has failed, a "failed call"
  367. timeout indicates the time to wait before initiating a new call. The
  368. activity timeout is represented by one of 3 timeouts including
  369. "inactivity", "tcp close", and "non tcp", representing the conditions
  370. when TCP connections are active, no TCP connections are active, and
  371. non TCP traffic is active.
  372.  
  373. The concept of a modem has been expanded to include a modem rotary. A
  374. rotary is a group of modems that are used in a round robin fashion.
  375. With a bank of modems and phone lines, there are basically two ways
  376. to pick which modem to use next:  "first available" and "next
  377. available". The "next available" option corresponds to a "rotary", a
  378. round robin selection, and can be used in order to be more tolerant
  379. of a single modem or phone failure.  Given modems 1 to N, if modem
  380. number 1 fails, the "first available" selection will always fail and
  381. the "next available" selection will fail 1 out of N times.
  382.  
  383. SunOS allows use of a single modem for both dial in and dial out
  384. through the use of two minor device numbers for each port.  This
  385. facility has been completely integrated into this software so that a
  386. single port can be easily used for both incoming and outgoing calls.
  387.  
  388. A new program "dplogin" is included which shares a number of
  389. functions with "dpd".  "dplogin" is used as a login shell for
  390. incoming calls and uses the same configuration file as "dpd".  It
  391. handles locking and logging in a compatible way.
  392.  
  393. A call log file is now generated for both incoming and outgoing
  394. calls. Each line of the file corresponds to a successful call and
  395. includes the following information: remote site name, tty device,
  396. date and time of initiation of connection, total connect time,
  397. initiating program (dpd or dplogin), protocol and port of initiating
  398. request (like tcp/smtp), and for both input and output, a report is
  399. given of number of packets, bytes, and errors. The protocol and port
  400. information is only available for outgoing calls.  This information
  401. can be very useful for analyzing call patterns and minimizing costs.
  402.  
  403. An auxiliary program facility is provided.  If so configured,
  404. whenever a modem connection is made, an auxiliary program can be
  405. run.  This program could, for instance, check queues for outgoing
  406. traffic and make use of the the connection to transfer mail, print
  407. jobs, or other similar queued files. This could be easily tuned to be
  408. site specific to reduce the number of calls made by taking advantage
  409. of connections when they happen.
  410.  
  411. 3.5 "sys" directory
  412.  
  413. The sys directory includes the kernel modules, including the
  414. following:
  415.  
  416. 3.5.1 ppp_async.c
  417.  
  418. The "pppasync" streams module, which is used in conjunction with
  419. both the original "pppif" module and the new "dpif" module.
  420.  
  421. 3.5.2 dp_if.c
  422.  
  423. The new version of ppp_if.c which has been heavily modified to
  424. support the dialup on demand mode of operation. dp_if.c is based
  425. originally on the ppp_if.c module from Clarkson University and Brad
  426. Clements.  It has been expanded in several ways.
  427.  
  428. The connection status of each interface is now handled and a number
  429. of timeouts are implemented.  The timeouts include the following:
  430.  
  431. callwait:    time to wait for a call to complete
  432. failedcall:    time to wait before trying another call
  433. inactivity:    disconnect after no packets in A seconds.
  434. tcp_close:    disconnect C seconds after last TCP connection is closed
  435.         and no packets.
  436. non_tcp:    disconnect U seconds after last non-TCP packet given no
  437.         activity and no TCP connections.
  438.  
  439. The timeouts can be set from the dp configuration file.
  440.  
  441. In addition, a completely new module keeps track of TCP connections
  442. in progress and will notice when all connections close and the line
  443. can be disconnected using one of the "fast timeouts" (tcp_close or
  444. non_tcp).
  445.  
  446. The Van Jacobson header compression code is included and works well
  447. with this package.
  448.  
  449. Included within dp_if.c is a driver for the "pppdial" streams device
  450. that allows the kernel to request the initiation of calls from the
  451. "dpd" program.
  452.  
  453. 3.6 "dptrace" directory
  454.  
  455. Dptrace is a simple program that prints the request trace file.  As
  456. each dialup request arrives through /dev/dp0, the dpd program writes
  457. the current time and the current request to the file
  458. "${DPLOG_DIR}/req.trace". This program reads that file and formats the
  459. requests into a readable format. The program can be helpful in
  460. debugging and tuning the network.
  461.  
  462. 3.7 "modem" directory
  463.  
  464. This directory contains a program to set modem options on Hayes
  465. compatible modems.  The "setmodem" command can be invoked as:
  466.  
  467.     setmodem [-v] scriptfile device [baud]
  468.  
  469. Scriptfile contains a number of AT commands that will be fed to the
  470. modem. The setmodem program knows enough to expect OK returns from
  471. the modem and waits until the OK to proceed to the next AT command.
  472.  
  473. Scripts for the telebit T1600, T3000, and WorldBlazer modems are provided
  474. and have been tested.  You can modify these further to suit your configuration.
  475.  
  476. In addition, there is a shell script "initmodem.sh" which can be
  477. invoked as:
  478.  
  479.     initmodem scriptfile outdev indev [baud]
  480.  
  481. The scriptfile is the same as in setmodem, and the outdev corresponds
  482. to the device in setmodem, but the indev is the login side of the
  483. same device that is given in /etc/ttytab.  This script first edits
  484. /etc/ttytab to turn the login off for that port.  This allows
  485. everything to work correctly with the softcarrier options, etc.  The
  486. program resets the port before completion and generally is the preferred
  487. way to handle the initialization of devices.
  488.  
  489. 3.8 "aux" directory
  490.  
  491. The aux directory contains the sources for auxiliary programs that
  492. can be run when connections are established.  If so configured in the
  493. "${DP_CONFDIR}/conf" file, whenever a modem connection is made,
  494. an auxiliary program can be run.
  495.  
  496. Currently, the only program provided is a program called ckmailq.
  497. This looks in the mail spool directory for outgoing mail that is not
  498. currently being processed.  If such mail exists, it starts up
  499. sendmail with the proper options.
  500.  
  501. Other similar programs could be written for other queued traffic such
  502. as print jobs or uucp requests.  This can be used to "poll" for SMTP
  503. mail when a remote site can't initiate calls on it's own.
  504.  
  505. 3.9 "access" directory
  506.  
  507. The access directory contains several example files for controlling
  508. remote access and timeouts.  These are installed in "${DPACCESS_DIR}.
  509.  
  510. 3.10 "script" directory
  511.  
  512. The script directory contains several dialing and login scripts.
  513. These can be used as examples for your particular modems, etc.
  514. These files are installed in ${DPSCRIPT_DIR}.
  515.  
  516. 3.11 "cron" directory
  517.  
  518. The cron directory contains two shell programs (daily and monthly)
  519. that can be run via crontab in order to keep the ${DPLOG_DIR} directory
  520. from getting too large.  The file dp.crontab contains the two entries
  521. that need to be manually entered into root's crontab in order for these
  522. programs to be run via cron.
  523.  
  524.  
  525. 4. Building & Installation
  526.  
  527. In this release there are two ways to install dp. One is to use the
  528. loadable module support in the current version, but this has known
  529. problems with unloading (which may not be a problem in most situations).
  530. The other method is to install the dp drivers directly into the kernel
  531. with a kernel rebuild.  This option will go away with Solaris 2.0, but
  532. works quite will under Solaris 1.0, and has no known problems.
  533. In the end, you will need to use the method that is most appropriate
  534. in your situation. Below, both methods are covered in detail.
  535.  
  536. In either case, the rest of dp must be built and installed in the way
  537. given below.
  538.  
  539. 4.1 Loadable Module Version Install
  540.  
  541. 4.1.1 Building & Installing
  542.  
  543. In most cases, for SunOS 4.1.x at least, dp should build "out of the
  544. box", and you should just do this:
  545.  
  546. *    According to local policy, create a new group called "ppp", we
  547.     suggest an id of 600. This would normally be done by adding an entry
  548.     to "/etc/groups" or adding an entry on the NIS master if you use
  549.     that. For more details see section XXX.
  550.  
  551. *    Unpack the distribution, which creates a directory called dp-2.3/
  552.  
  553. *    cd to dp-2.3/
  554.  
  555. *    type "make" and make sure there were no errors, then
  556.  
  557. *    Become "root", and type "make install", which will create all the
  558.     necessary directories and copy the files required across setting the
  559.     correct ownerships and permissions.
  560.  
  561. 4.1.2 Using Loadable DP
  562.  
  563. For general configuration details you should proceed to section XXX,
  564. but in addition you have to set up your system to load the modules at
  565. some stage, usually at boot time. To run from "/etc/rc.local" you
  566. should add the following lines to the file:
  567.  
  568.     if [ -f ${DPMODULE_DIR}/startdp ]; then
  569.         ${DPMODULE_DIR}/startdp
  570.         echo "started dialup PPP"
  571.     fi
  572.  
  573. Be sure to modify the ${DPMODULE_DIR} to reflect your system installation.
  574.  
  575. 4.2 In-Kernel Version Install
  576.  
  577. For whatever reason, it may be necessary to install the dp modules in
  578. the kernel. The main reason is that the loadable modules are not
  579. fully supported at this release, or local policy may curtail the use
  580. of them in future release. This section goes through manual
  581. installation procedure.
  582.  
  583. The dp network interface must be installed in the kernel. To install
  584. this software, we must reconfigure, rebuild, and reboot with a new
  585. kernel (/vmunix).
  586.  
  587. 4.2.1 /usr/sys/conf.common/files.cmn
  588.  
  589. So that the "config" program knows where to find the drivers, the
  590. following lines must be added to the end of the file
  591. "/usr/sys/conf.common/files.cmn":
  592.  
  593.     os/dp_if.c        optional dp
  594.     os/ppp_async.c        optional dp
  595.  
  596. 4.2.2 /usr/sys/sun/conf.c
  597.  
  598. This file will contain the description of the pppdial streams
  599. device. This device allows communication between the kernel network
  600. interface and a user program "dpd" which makes calls and establishes
  601. connections.
  602.  
  603. Before the definition of the cdevsw array, a number of #defines are
  604. set up for each device.  After the last such setup and before the
  605. cdevsw array, place the following lines:
  606.  
  607. #include "dp.h"        /* Dialup PPP */
  608. #if NDP > 0
  609. extern struct streamtab ppp_dialinfo;
  610. #define    dptab    &ppp_dialinfo
  611. #else
  612. #define    dptab    0
  613. #endif
  614.  
  615. The cdevsw array contains an entry for each supported device.  The
  616. supported devices and the number of such devices varies somewhat from
  617. release to release. In SunOS4.1.1, the last supported device is 103,
  618. as indicated in a comment to the right of the device definition. 
  619. Assuming no other local devices, then, the Dialup PPP device would be
  620. device number 104 and defined as follows:
  621.  
  622.     {    /* Dialup PPP */
  623.     nodev,    nodev,    nodev,    nodev,        /*104*/
  624.     nodev,    nodev,    nodev,    0,     dptab,    0,
  625.     },
  626.  
  627. The exact position in the array does not really matter as long as you
  628. use the correct number when you create the device.  In this case, 104
  629. is the major number of the device and will be used later when the
  630. device is created.
  631.  
  632. 4.2.3 /usr/sys/sun/str_conf.c
  633.  
  634. This file defines the 3 streams modules involved.  Dialup PPP uses
  635. "dpif", "pppdial", and "pppasync".
  636.  
  637. Near the beginning of the file, there are a number of #include
  638. directives. After the last one, place the following line:
  639.  
  640.     #include "dp.h"
  641.  
  642. Then, there are a number of extern definitions based on #if
  643. directives. After the last one, place the following lines:
  644.  
  645.     #if NDP > 0
  646.     extern struct streamtab dp_ifinfo;
  647.     extern struct streamtab ppp_dialinfo;
  648.     extern struct streamtab ppp_asyncinfo;
  649.     #endif
  650.  
  651. Then, there is a fmodsw array defined.  This array defines all the
  652. streams modules in the system.  Near the end of this array,
  653. before the loadable modules are defined (VDDRV), put the
  654. following lines:
  655.  
  656.     #if NDP > 0
  657.         { "dpif", &dp_ifinfo },
  658.         { "pppdial", &ppp_dialinfo },
  659.         { "pppasync", &ppp_asyncinfo },
  660.     #endif
  661.  
  662. 4.2.4 /usr/sys/sun4c/conf/CONFIG_NAME
  663.  
  664. Each kernel is built from a configuration file with some name.  By
  665. default, when SunOS boots, it places that name in a comment in the
  666. file /etc/motd. You can tell which configuration was used to build
  667. the current system by looking at that file.
  668.  
  669. It is probably best to copy that configuration file to a new file,
  670. perhaps with "_DP" appended to the name.  For purposes of discussion,
  671. we will call the new configuration "SYS_DP".  Then edit the new
  672. configuration file and add the following lines:
  673.  
  674. #
  675. # Point to Point Protocol (PPP) devices
  676. #
  677. pseudo-device    dp    init    dp_attach
  678.  
  679. If you want more than one interface (like for a central hub), just
  680. put the number after "dp".  For instance, for 8 interfaces, use the
  681. line:
  682.  
  683. pseudo-device    dp8    init    dp_attach
  684.  
  685. 4.2.5 New Source Files
  686.  
  687. From the "sys" directory in the distribution, copy the following
  688. files to the "/usr/sys/os" directory:
  689.  
  690.     dp_if.c
  691.     ppp_async.c
  692.  
  693. From the "h" directory in the distribution, copy the following files
  694. to the "/usr/sys/sys" directory".
  695.  
  696.     dp_str.h
  697.     if_ppp.h
  698.     slip_var.h
  699.     slcompress.h
  700.  
  701. 4.2.6 Configuring and Compiling
  702.  
  703. In the directory "/usr/sys/sun4c/conf", run the command:
  704.  
  705.     /usr/etc/config SYS_DP
  706.  
  707. Use the name of the file you edited in the previous step in place of
  708. "SYS_DP". Then, change to the directory "../SYS_DP", and run make. 
  709. You should get a new kernel "vmunix".  In order to install the new
  710. kernel on your system, you should save a copy of the old kernel with
  711. "cp /vmunix /vmunix.old", then "cp /usr/sys/sun4c/SYS_DP/vmunix
  712. /vmunix".  Then, reboot using the "shutdown" or "reboot" command.
  713.  
  714. 4.2.7 Creating Devices
  715.  
  716. Only one new device needs created in the /dev directory.  This is the
  717. "pppdial" streams device that is used to pass dial requests from the
  718. kernel "dpif" module to the "dpd" program.  It should be created with
  719. a major number that is dependent on the exact contents of the
  720. "/usr/sys/sun/conf.c" file. For this example, we will assume the
  721. major number is 104.  These are the commands you would use:
  722.  
  723.     # /usr/etc/mknod /dev/dp0 c 104 0
  724.     # /usr/etc/chown root.staff /dev/dp0     chmod 600 /dev/dp0
  725.  
  726. 4.3 System Files
  727.  
  728. A number of system files need entries added according to your own
  729. setup. These files will be discussed here.
  730.  
  731. 4.3.1 /etc/passwd & /etc/group
  732.  
  733. This procedure may vary slightly depending on the use of NIS or
  734. shadow password files.  But, basically you will be defining users and
  735. groups much like you would for a new system user.  Feel free to adapt
  736. this procedure to your specific arrangement.
  737.  
  738. You should have defined a new group called "ppp" earlier in the
  739. installation if you used the loadable module support, otherwise
  740. assign a suitable id. In our case, we used the group id 600.  For
  741. each remote site that will be calling in, you need to create a login.
  742. We have used the convention that PPP logins all start with the
  743. letter 'P'.  This has made it easy to identify it as a "special" sort
  744. of login when looking at the output of "who" or "finger".
  745.  
  746. Assume that we have 2 remote sites: "rem1" and "rem2".  We have
  747. selected available user id's 601 and 602, respectively. 
  748. Additionally, we have selected group id 600 for group "ppp".  The
  749. "/etc/passwd" file entries would take the following form:
  750.  
  751.     Prem1:*:601:600:PPP Remote 1:/var/adm/dp:/usr/dp/bin/dplogin
  752.     Prem2:*:602:600:PPP Remote 2:/var/adm/dp:/usr/dp/bin/dplogin
  753.  
  754. The entry in the "/etc/group" file would look like this:
  755.  
  756.     ppp:*:600:Prem1,Prem2
  757.  
  758. After creating these entries, we would use the command "passwd Prem1"
  759. to set the password for the "Prem1" account, and similarly for
  760. "Prem2".
  761.  
  762. 4.3.2  /etc/rc.boot
  763.  
  764. At some point in the boot process, you must arrange to run ifconfig
  765. on all your "dp" interfaces.  Sun has arranged code in /etc/rc.boot
  766. to do all the ifconfig's automatically. If you do not use the dynamic
  767. loading, you can use this code, but it needs minor modification
  768. to make it work. You can simply add the ifconfig lines
  769. directly in one of the rc files (before starting dpd), or you can
  770. modify /etc/rc.boot and use the Sun scheme. Here are the
  771. modifications necessary to /etc/rc.boot. The line:
  772.  
  773.     hostname="`shcat /etc/hostname.??0            2>/dev/null`"
  774.  
  775. needs changed to:
  776.  
  777.     hostname="`shcat /etc/hostname.?e0            2>/dev/null`"
  778.  
  779. Later, this file messes with IFS and then looks for files of the form
  780. "/etc/hostname.*".  The lines:
  781.  
  782.     IFS="$IFS."
  783.     set `echo /etc/hostname\.*`
  784.  
  785. need changed to:
  786.  
  787.     SIFS=$IFS
  788.     IFS="$IFS."
  789.     set `echo /etc/hostname\.*`
  790.        IFS=$SIFS
  791.  
  792. The line:
  793.  
  794.     ifconfig $1 "`shcat /etc/hostname\.$1`" netmask + -trailers up
  795.  
  796. needs changed to:
  797.  
  798.     ifconfig $1 `shcat /etc/hostname\.$1` netmask + -trailers up
  799.  
  800. In the file "/etc/hostname.dp0", you need to place the source and
  801. destination addresses for the first PPP link.  The source address is
  802. the address on the local machine, and the destination address is the
  803. address on the remote machine. These addresses can be hostnames from
  804. the hosts database or internet numeric dot notation.  Create one of
  805. these files for each PPP link.
  806.  
  807. 4.3.2 /etc/rc.local
  808.  
  809. After the "ifconfig" commands are run at boot time, before using the
  810. PPP interfaces for anything else, you must start the Dialup PPP
  811. Daemon (PPP). In /etc/rc.local, there is a line similar to:
  812.  
  813.     ifconfig -a netmask + broadcast + > /dev/null
  814.  
  815. Right after that line is a good place to start dpd.  The lines to add
  816. look like this:
  817.  
  818.     #
  819.     # Start Dialup PPP Daemon.
  820.     #
  821.     if [ -f /etc/dp.start ]; then
  822.         /etc/dp.start
  823.         echo 'starting Dialup PPP Daemon.'
  824.     fi
  825.  
  826. 4.3.4 /etc/hosts
  827.  
  828. In short, you need an entry in "/etc/hosts" for each "dp" interface.
  829. Each PPP link is a network in it's own right.  So, it to be assigned
  830. a unique internet IP number for each end.
  831.  
  832. For broadcast networks, a network address is assigned for each
  833. physical network. Host numbers are chosen for each host on the
  834. network.  For an example class C addresses 199.10.11.14 and
  835. 199.10.11.52 are both on the same IP network (199.10.11). These
  836. addresses represent hosts 14 and 52 on that network. IP routers know
  837. how to get to the 199.12.13 network and pass packets on to the
  838. appropriate gateway.  Once the packets get to that network, they are
  839. then routed to host 14, 52, or whatever.
  840.  
  841. In contrast, the number of hosts on a Point to Point network is
  842. always 2. So, in IP routing, we never actually use a route to the
  843. network.  We just use a route to each individual address (both ends).
  844. So, if we are administering several Point to Point networks, we can
  845. use a single IP network, and assign pairs of addresses.  For
  846. instance, assume we have a class C network 199.10.20 assigned for PPP
  847. links.  Our first link could have the addresses 199.10.20.1 and
  848. 199.10.20.101.  Our second link could have the addresses 199.10.20.2
  849. and 199.10.20.102.  We need two addresses for each link since we need
  850. to assign an address to each end.  Using addresses differing by 100
  851. for both ends of the link has proven to be a convenient convention
  852. for us. It helps us to keep track of things when dealing with a large
  853. central hub. 
  854. So, let's say we have a hub machine called "hub", with 2 PPP links,
  855. "dp0", and "dp1" serving the machines "rem1" and "rem2".  Each of
  856. these remote machines have a single PPP interface "dp0".  Using the
  857. addresses from the previous examples, we would have /etc/hosts
  858. entries as follows:
  859.  
  860.     199.10.11.14    hub hub-le0
  861.     199.10.20.101    hub hub-dp0
  862.     199.10.20.102    hub hub-dp1
  863.     199.10.20.1    rem1 rem1-dp0
  864.     199.10.20.2    rem2 rem2-dp0
  865.  
  866. These are just guidelines and address assignment can be done in a
  867. different ways based on local conventions and local politics.  In
  868. addition to the hosts file, many sites will also be using the DNS
  869. (Domain Name System). The DNS files need updated to reflect the new
  870. network addresses in a similar way.  In addition, routing can be
  871. quite different based on the protocols involved.  For further
  872. discussion about DNS and routing, see the later sections detailing a
  873. sample configuration.
  874.  
  875. 5.  Configuration
  876.  
  877. 5.1. "/etc/dp.conf" file
  878.  
  879. Earlier versions of Dialup PPP placed files in very specific places.
  880. dp-2.3 allows flexible placement of files.  The only really fixed
  881. file is /etc/dp.conf.  It basically contains a list of pathnames
  882. for standard things.  It looks like this:
  883.  
  884.     #
  885.     # Config file for Dialup PPP.
  886.     #
  887.     # This file specifies the paths where all the related PPP files and
  888.     # programs are located.
  889.     #
  890.     DPCONF_DIR=/etc/dp        # System Specific Files
  891.     DPLOG_DIR=/var/adm/dp        # Log and Trace Files
  892.     DP_DIR=/usr/dp            # Common Files for All Systems
  893.     DPBIN_DIR=${DP_DIR}/bin        # Programs
  894.     DPSCRIPT_DIR=${DP_DIR}/script    # Standard Dialing Scripts
  895.     DPACCESS_DIR=${DP_DIR}/access    # Standard Access Files
  896.     DPAUX_DIR=${DP_DIR}/aux        # Auxilliary Programs
  897.     DPMODEM_DIR=${DP_DIR}/modem    # Modem Support Programs
  898.     DPMODULE_DIR=${DP_DIR}/modules    # Kernel Modules
  899.  
  900. The DPCONF_DIR typically contains files that are specific to a given
  901. system.  The "${DPCONF_DIR}/conf" file contains the bulk of the interface
  902. configuration.  In addition, script and access files specific to a
  903. single system can be placed in this directory.
  904.  
  905. The DPLOG_DIR contains log files and files that get written frequently.
  906.  
  907. The other directories should be relatively static from one machine
  908. to the next.  The default configuration file groups them all under ${DP_DIR}.
  909. This can be changed to suit local needs. 
  910.  
  911. 5.1  "${DPCONF_DIR}/conf" file
  912.  
  913. When, the programs "dpd" and "dplogin" are started, they read a
  914. configuration file "${DPCONF_DIR}/conf".  This file has a
  915. definition for each interface, each modem, and optionally a number of
  916. modem rotaries.
  917.  
  918. An definition of begins with a line beginning in the first column.
  919. Continuation lines must begin with white space (SPACE or TAB
  920. characters). Comments can be placed anywhere in a line and must begin
  921. with #. Strings can be delimited by double quote characters (""),
  922. if necessary.
  923.  
  924. For a given definition, each variable is given a value with a the
  925. variable name, an equal sign, and the value.  For instance, the first
  926. entry in the definition for the dp0 interface is:
  927.  
  928.     IF=dp0
  929.  
  930. This section defines all the possible options, their possible values,
  931. and gives some examples to show how they might be used.
  932.  
  933. 5.1.1  Interfaces
  934.  
  935. Each interface corresponds to a logical network connection to a
  936. single remote site.  Provisions are made in the interface definition
  937. to specify how calls should be made and received in order to handle
  938. traffic on that interface.
  939.  
  940. 5.1.1.1  IF
  941.  
  942. The IF variable must be the first entry in the interface definition.
  943. It's value is the name of the network interface (e.g. IF=dp0).
  944.  
  945. 5.1.1.2  SYS
  946.  
  947. The SYS variable can be optionally set to indicate a system name to
  948. be used when making log entries.  If the SYS variable is not
  949. explicitly set, it is defaulted to be the internet name of the
  950. remote site (as returned by gethostbyaddr()), or if that fails, the
  951. internet address of the remote site in dot notation.
  952.  
  953. 5.1.1.3  MODEMS
  954.  
  955. The MODEMS variable specifies the modems or modem rotaries that
  956. should be used to make calls for this interface.  At least one modem
  957. or modem rotary must be specified.  If more than one modem or modem
  958. rotary is specified, when a call request is made, each entry in the
  959. list is tried in turn until an available modem is found.  The names
  960. used in this list must correspond to a MODEM or ROTARY definition as
  961. specified in the configuration file.
  962.  
  963. 5.1.1.4  PHONE
  964.  
  965. The PHONE variable specifies the phone number that will be passed to
  966. the DIAL_SCRIPT as defined by the modem in use on a particular call.
  967.  
  968. 5.1.1.5  LOGIN_SCRIPT
  969.  
  970. The LOGIN_SCRIPT variable specifies an expect script that will be
  971. used to log into the remote system for the purposes of establishing a
  972. PPP connection. These scripts are found, by default, in
  973. ${DPSCRIPT_DIR} and will be described in detail later.
  974. Scripts specific to a single system can also be placed in ${DPCONF_DIR}.
  975.  
  976. 5.1.1.6  LOGIN_ARGS
  977.  
  978. The LOGIN_ARGS variable is a comma separated list of arguments to the
  979. expect script as defined by the value of LOGIN_SCRIPT.  This is
  980. typically the login and password on the remote machine.
  981.  
  982. 5.1.1.7  LOGIN
  983.  
  984. The LOGIN variable has practically nothing to do with the
  985. LOGIN_SCRIPT and LOGIN_ARGS variables, both of which deal with
  986. outgoing calls.  The LOGIN variable, instead, is set to allow a
  987. particular login id to be used to call in to establish a PPP
  988. connection.  When dplogin is called, it knows what account was used
  989. to log into the system.  It searchs the configuration file for an
  990. interface where the LOGIN variable is set to that same account.
  991.  
  992. 5.1.1.8  TRACE
  993.  
  994. The TRACE variable can be used to specify a trace file for the
  995. calling script.  The trace files are written in ${DPTRACE_DIR}.
  996. If there is a problem with establishing a particular connection,
  997. this variable can be set to see what characters are being
  998. transfered when the DIAL_SCRIPT and LOGIN_SCRIPT are both run.
  999.  
  1000. 5.1.1.9  ACCESS
  1001.  
  1002. An ACCESS file can be specified.  This file defines a number of
  1003. additional variables and can be used to limit the conditions for
  1004. which calls will be made.  This file is located, by default, in the
  1005. ${DPACCESS_DIR} directory. Access files local to a single system can
  1006. be placed in the ${DPCONF_DIR}. This file will be described in detail in
  1007. the next section.
  1008.  
  1009. 5.1.1.10  PPP_ARGS
  1010.  
  1011. When the PPP program "${DPBIN_DIR}/dp" is started by dpd or dplogin, you can
  1012. specify additional arguments to be put in the argument list.  For
  1013. instance, if you are using dp.2.3 to talk to a dp.2.0 installation,
  1014. the default header compression negotiation has changed with the new
  1015. patch level of PPP. So, in the 2.3 configuration file, you can put
  1016. the line:
  1017.  
  1018.     PPP_ARGS=vjmode,old
  1019.  
  1020. This will talk to a patchlevel 4 PPP correctly and the option negotiation
  1021. will function properly.
  1022.  
  1023. 5.1.1.11  AUX
  1024.  
  1025. The AUX variable specifies an auxiliary program that will be run
  1026. after a PPP link is established for a particular interface.  The
  1027. default location for these programs is ${DPAUX_DIR}.  An example
  1028. program is provided that checks the sendmail queue for queued
  1029. messages.  This could be run to make sure mail messages are sent out
  1030. whenever the link is established for any reason.
  1031.  
  1032. 5.1.1.12  AUX_ARGS
  1033.  
  1034. Arguments may be provided to AUX program by specifying them here as
  1035. a comma separated list of arguments, much like the PPP_ARGS variable.
  1036. The last argument provided to the AUX script is always the system name
  1037. from the SYS variable.
  1038.  
  1039. 5.1.1.13  LOG_LEVEL
  1040.  
  1041. The Log Level can be set when dpd is started.  The LOG_LEVEL variable
  1042. overides the current log level for calls made to this system.  In addition,
  1043. dplogin will set the same LOG_LEVEL for incoming calls.
  1044.  
  1045. 5.1.1.14  ASYNC_MAP
  1046.  
  1047. The PPP program can be setup to avoid using certain control characters in
  1048. the case of links that aren't totally transparent.  This takes the form of
  1049. a 8 digit hexadecimal string representing a 32 bit number.  The lowest
  1050. to highest order bits of the number correspond to the ASCII character
  1051. represented by 0 through 31.  If the bit is set, that character will
  1052. not be transmitted on the line, but will instead be replaced by a special
  1053. escape sequence.  By default, the ASYNC_MAP is set to 0, which means pass
  1054. all characters since we have a totally transparent link.  This variable
  1055. applies to all calls made to this system independent of which modem was used.
  1056.  
  1057. 5.1.2  Modems
  1058.  
  1059. A modem entry is required for each serial device that can be used to
  1060. establish a connection to a remote system.
  1061.  
  1062. 5.1.2.1  MODEM
  1063.  
  1064. The MODEM variable must be the first entry in the modem definition.
  1065. It's value is an arbitrary (hopefully descriptive) name.  This same
  1066. name is used in the interface definition as a value for the MODEMS
  1067. variable.
  1068.  
  1069. 5.1.2.2  DEV
  1070.  
  1071. The DEV variable is set to the physical serial device name path name.
  1072. If the entry does not begin with a "/", then it is assumed that the
  1073. device appears in the "/dev" directory.  Sun has a scheme for using
  1074. the same line for dial out and dial in.  For most configurations, you
  1075. should use the name of the dial out device.  This is the one with the
  1076. 0x80 bit set in the minor number. If necessary, you can make the
  1077. dialout device for a given login port. As an example, assume we are
  1078. using "ttya" and we want to make a dialout device "cua0". Here are
  1079. some example commands run as root to make the device.
  1080.  
  1081.     # ls -lg /dev/ttya
  1082.     crw--w--w-  1 root     wheel     12,   0 May 21 12:30 /dev/ttya
  1083.     # /etc/mknod /dev/cua0 c 12 128
  1084.     # chmod 660 /dev/cua0
  1085.     # /etc/chown uucp.uucp /dev/cua0
  1086.     # ls -lg /dev/ttya /dev/cua0
  1087.     crw--w--w-  1 root     wheel     12,   0 May 21 12:30 /dev/ttya
  1088.     crw-rw----  1 uucp     uucp      12, 128 May 21 12:30 /dev/cua0
  1089.  
  1090. Then, you would put "DEV=cua0" in your modem definitions to use this
  1091. device.
  1092.  
  1093. 5.1.2.3  DIAL_SCRIPT
  1094.  
  1095. The DIAL_SCRIPT variable is the name of a script file.  The directories
  1096. ${DPCONF_DIR} and ${DPSCRIPT_DIR} are searched for these files.
  1097. By convention, common scripts are placed in ${DPSCRIPT_DIR} while
  1098. scripts specific to single systems are placed in ${DPCONF_DIR}.
  1099. This script will be used to interact with the modem and make the call.
  1100. The phone number is passed as the first and only argument to the script.
  1101.  
  1102. The next section describes modem rotaries.  If all the modems in a
  1103. rotary use the same DIAL_SCRIPT, it is not necessary to set each one
  1104. individually.  The DIAL_SCRIPT variable is set from the ROTARTY
  1105. definition.
  1106.  
  1107. 5.1.2.4  BAUD
  1108.  
  1109. The BAUD variable is the baud rate to use for outgoing calls on this
  1110. modem.
  1111.  
  1112. The next section describes modem rotaries.  If all the modems in a
  1113. rotary use the same baud rate, it is not necessary to set each one
  1114. individually.  The BAUD variable is set from the ROTARTY definition.
  1115.  
  1116. 5.1.2.5  DIAL_CHARMAP
  1117.  
  1118. This variable is set in order to map characters embedded in phone numbers
  1119. to the appropriate modem control character.  For instance, it may
  1120. be a common practice to include a '=' in phone numbers when you have to
  1121. wait for a secondary dial tone and a '-' when you just have to pause for
  1122. a second.  For Telebit modems, then the mapping would be performed with:
  1123.  
  1124.     DIAL_CHARMAP==W-,
  1125.  
  1126. which means wait for dial tone is 'W', and a short pause is ','.
  1127. This allows modems of different brands to be used without undue
  1128. difficulty.
  1129.  
  1130. 5.1.2.6  ASYNC_MAP
  1131.  
  1132. The PPP program can be setup to avoid using certain control characters in
  1133. the case of links that aren't totally transparent.  This takes the form of
  1134. a 8 digit hexadecimal string representing a 32 bit number.  The lowest
  1135. to highest order bits of the number correspond to the ASCII character
  1136. represented by 0 through 31.  If the bit is set, that character will
  1137. not be transmitted on the line, but will instead be replaced by a special
  1138. escape sequence.  By default, the ASYNC_MAP is set to 0, which means pass
  1139. all characters since we have a totally transparent link.  This variable
  1140. applies to all calls made with this modem.
  1141.  
  1142. 5.1.3  Modem Rotaries
  1143.  
  1144. If you are administering a central hub machine with several modems,
  1145. you may wish to define a modem rotary.  When defining the interfaces,
  1146. you can set the modem variable to a list of modems (or rotaries). 
  1147. Each one will be tried in turn until an available modem if found. 
  1148. For a large number of modems, this is not very tolerant to hardware
  1149. failures.  If the first modem in the list is broken, calls will
  1150. always fail.  This approach is sometimes called using the "first
  1151. available" modem.
  1152.  
  1153. An alternative approach is to define modem rotaries.   A rotary is
  1154. best described as a "next available" approach.  The software keeps
  1155. track of the last modem used, and always starts with the next modem
  1156. in the list.  When the end of the list is reached, the first modem
  1157. becomes the next modem. This reduces overhead of finding a free modem
  1158. and insures that a bad modem will not totally shut down
  1159. communications.
  1160.  
  1161. 5.1.3.1  ROTARY
  1162.  
  1163. The ROTARY variable must be the first entry in the modem definition.
  1164. It's value is an arbitrary (hopefully descriptive) name.  This same
  1165. name is used in the interface definition as a value for the MODEMS
  1166. variable. Modems and rotaries can both be listed in the MODEMS
  1167. variable equally well.
  1168.  
  1169. 5.1.3.2  MODEMS
  1170.  
  1171. The MODEMS variable is set to a comma separated list of one or more
  1172. modems. The entries in the list are the names of the modems as
  1173. defined by their MODEM variable.  All entries in this list must be
  1174. modems.  Other rotaries cannot be used here.
  1175.  
  1176. 5.1.3.3  DIAL_SCRIPT
  1177.  
  1178. The DIAL_SCRIPT variable is the name of a script file.  The directories
  1179. ${DPCONF_DIR} and ${DPSCRIPT_DIR} are searched for these files.
  1180. By convention, common scripts are placed in ${DPSCRIPT_DIR} while
  1181. scripts specific to single systems are placed in ${DPCONF_DIR}.
  1182. This script will be used to interact with the modem and make the call.
  1183. The phone number is passed as the first and only argument to the script.
  1184.  
  1185. This entry will be used if the MODEM definition does not define a
  1186. DIAL_SCRIPT itself.  This is useful when a pool of modems are all the
  1187. same type and the DIAL_SCRIPT is the same for all of them.
  1188.  
  1189. 5.1.3.4  BAUD
  1190.  
  1191. The BAUD variable is the baud rate to use for outgoing calls on any
  1192. modem in this rotary.
  1193.  
  1194. This entry will be used if the MODEM definition does not define a
  1195. BAUD itself.  This is useful when a pool of modems are all the same
  1196. type and the baudrate is the same for all of them.
  1197.  
  1198. 5.1.3.5  DIAL_CHARMAP
  1199.  
  1200. This variable is set in order to map characters embedded in phone numbers
  1201. to the appropriate modem control character.  For instance, it may
  1202. be a common practice to include a '=' in phone numbers when you have to
  1203. wait for a secondary dial tone and a '-' when you just have to pause for
  1204. a second.  For Telebit modems, then the mapping would be performed with:
  1205.  
  1206.     DIAL_CHARMAP==W-,
  1207.  
  1208. which means wait for dial tone is 'W', and a short pause is ','.
  1209. If all the modems in a rotary are of the same brand, it is convenient
  1210. to set this variable in the rotary definition rather than setting it
  1211. in each modem definition.
  1212.  
  1213. 5.1.3.6  ASYNC_MAP
  1214.  
  1215. The PPP program can be setup to avoid using certain control characters in
  1216. the case of links that aren't totally transparent.  This takes the form of
  1217. a 8 digit hexadecimal string representing a 32 bit number.  The lowest
  1218. to highest order bits of the number correspond to the ASCII character
  1219. represented by 0 through 31.  If the bit is set, that character will
  1220. not be transmitted on the line, but will instead be replaced by a special
  1221. escape sequence.  By default, the ASYNC_MAP is set to 0, which means pass
  1222. all characters since we have a totally transparent link.  This variable
  1223. applies to all calls made with any modem in this rotary.  If all the modems
  1224. in a rotary are of the same brand, it is convenient to set this variable
  1225. in the rotary definition rather than setting it in each modem definition.
  1226.  
  1227. 5.2  Access Files
  1228.  
  1229. An access file can be defined to describe the conditions when a call
  1230. is permitted and to set the timeouts appropriately.  For instance, if
  1231. you have some sites that are long distance toll calls, and some that
  1232. are local calls, you may wish to have shorter timeouts on the toll
  1233. calls than on the locals.
  1234.  
  1235. The format of the access came from the BBN DialupIP software.  It has
  1236. been expanded in several ways, but it still looks pretty similar.
  1237. Aside from several small changes in the existing options, a series
  1238. of timeout specifications have been added.
  1239.  
  1240. 5.2.1 Timeouts
  1241.  
  1242. There are eight timeouts which can be specified, three that can
  1243. be set separately for incoming and outgoing calls, and 2 more that only
  1244. make sense for outgoing calls.  Here is a sample section from a access
  1245. file showing all 8 timeouts:
  1246.  
  1247.     #
  1248.     # Connection Timeouts
  1249.     #
  1250.     failedcall         25    # time to mark network as down after failed call
  1251.     callwait         50    # time to allow for call to go through
  1252.     #
  1253.     # Activity Timeouts
  1254.     #
  1255.     dial:inactivity    180    # time to let the connection sit idle
  1256.     dial:last_close      6    # fast timeout after last TCP close
  1257.     dial:non_tcp     10    # fast timeout for non-TCP traffic
  1258.     answer:inactivity    600    # time to let the connection sit idle
  1259.     answer:last_close    180    # fast timeout after last TCP close
  1260.     answer:non_tcp    180    # fast timeout for non-TCP traffic
  1261.  
  1262. Since we are not dialing 800 numbers, we are paying for calls made.
  1263. In that case, we set short timers so that disconnections are prompt.
  1264. For incoming calls, we set some limits just to keep the modem pool from
  1265. being tied up.
  1266.  
  1267. 5.2.1.1 Callwait
  1268.  
  1269. When the kernel "dpif" module requests a call be placed by "dpd", the
  1270. kernel starts the call wait timer.  If no status has been reported from "dpd"
  1271. within "Callwait" seconds, it is equivalent to receiving a "FAILURE" status
  1272. from "dpd".
  1273.  
  1274. 5.2.1.2 Failedcall
  1275.  
  1276. After a FAILURE status or after the expiration of the Callwait timer,
  1277. the interface is marked with the FAILEDCALL status.  With that status
  1278. set, no calls will be attempted.  After "Failedcall" seconds, the interface
  1279. status is marked as DISCON, and call attempts will again be made.
  1280.  
  1281. 5.2.1.3 Inactivity
  1282.  
  1283. If no packets have been sent or received through a PPP interface within
  1284. "Inactivity" seconds, PPP is terminated and the interface is marked as DISCON.
  1285.  
  1286. 5.2.1.4 Tcp_close
  1287.  
  1288. TCP packets contain information about connections starting and ending.
  1289. A count of active connections is maintained for each interface.  When
  1290. this count goes to zero, if no packets have been sent or received within
  1291. "Tcp_close" seconds, PPP is terminated and the interface is marked as DISCON.
  1292.  
  1293. 5.2.1.5 Non_tcp
  1294.  
  1295. When the active TCP connection count goes to zero, and non-TCP packets
  1296. are being transmitted, if no packets have been sent or received within
  1297. "Tcp_close" seconds, PPP is terminated and the interface is marked as DISCON.
  1298.  
  1299. 5.2.2 Protocols
  1300.  
  1301. We can limit the calls made by the protocol.  Here is a sample access
  1302. file entry that would only allow tcp, udp, and icmp packets:
  1303.  
  1304.     protocols    tcp udp icmp
  1305.  
  1306. The keyword "goodprotocols" can be used in place of "protocols".
  1307. In addition, the keyword "badprotocols" can be used to disallow calls
  1308. based on packets certain protocols.
  1309.  
  1310. Any protocol that is in the "/etc/protocols" file is a valid entry on this
  1311. line.  Please note that this only controls the initiation of a call request.
  1312. Once a call succeeds, other protocols can be transmitted.
  1313.  
  1314. 5.2.3 Times
  1315.  
  1316. By default, calls can be placed at any time.  If you wish to limit calls
  1317. during certain hours of certain days, you can place entries in the access
  1318. files containing the day and the hours when calls are should not be permitted.
  1319. The allowable days are:
  1320.  
  1321.     sun    sunday
  1322.     mon    monday
  1323.     tue    tuesday
  1324.     wed    wednesday
  1325.     thu    thursday
  1326.     fri    friday
  1327.     sat    saturday
  1328.     weekdays
  1329.     weekends
  1330.  
  1331. For instance, if calls should only be allowed during "business" hours of
  1332. monday through friday (8-5), with no calls in the evening or weekends,
  1333. you would use the following entries:
  1334.     
  1335.     weekdays    0 1 2 3 4 5 6 7 17 18 19 20 21 22 23 24
  1336.     weekends    0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
  1337.  
  1338. If a day is not mentioned either explicitly or via the weekday/weekend
  1339. keyword, then calls can be placed all day.
  1340.  
  1341. To allow calls only during times with lower rates, one might want to turn
  1342. off calls during the 8-5 business day.  This would be done with the following
  1343. line:
  1344.  
  1345.     weekdays    8 9 10 11 12 13 14 15 16
  1346.  
  1347. Calls would then be placed anytime before 8AM and after 5PM on weekdays
  1348. and any time on weekends.
  1349.  
  1350. 5.2.4 Hosts/Networks
  1351.  
  1352. To limit calls when certain hosts are involved, you can use further keywords.
  1353.  
  1354. In order to limit calls to packets which are destined to a list of specific
  1355. hosts, you would use the "allowto" (or equivalently "gooddstaddresses")
  1356. keyword.  If the access file has a line of this form, a call will fail for
  1357. packets having destination addresses not in this list.  So, if we wish
  1358. calls to be placed for only one hosts on the 192.100.10.0 network and the
  1359. goodhost.com host, a line of the following form would be used:
  1360.  
  1361.     allowto    192.100.10.0 goodhost.com
  1362.  
  1363. In order to limit where a packet may come from, you can use the "disallowfrom"
  1364. (or equivalently "badsrcaddresses") keyword.  If a call request is made
  1365. for a packet coming from an address in this list, then the call fails.
  1366. An example would be
  1367.  
  1368.     disallowfrom    badhost.edu
  1369.  
  1370. The addresses given in these lists can be the name of a network, the
  1371. name of a host, or equivalently an internet host or network address in
  1372. dot notation.
  1373.  
  1374. 5.3  Script Files
  1375.  
  1376. The script mechanism is used by the dpd program to interact with modems
  1377. and systems to make calls and log in to remote computers.  They provide a
  1378. full send-expect style facility, with many extensions to allow for
  1379. timeouts, alternative choices and others.  This is a direct extension
  1380. of the DialupIP 2.0 script file mechanism with the following additions:
  1381.  
  1382. - Two separate scripts are required for dialing and for login.
  1383.  
  1384. - Timeouts can be 0 to indicate matches of previously received data (via a
  1385.   mark/replay command pair).
  1386.  
  1387. - "recv" commands can match more than one alternative string
  1388.  
  1389. Script files contain a sequence of lines, each with a command and zero or
  1390. more arguments.  Blank lines and lines beginning with # are ignored.
  1391. Strings must be quoted with double quotes (") if they contain white space.
  1392. Standard C escape sequences are valid (\b, \f, \n, \r, \t, or \000 where 000
  1393. is any octal number).
  1394.  
  1395. Several example script files are provided in the distribution for dialing
  1396. several different Telebit modems directly into a remote system as follows:
  1397.  
  1398. t1600-dial    Dials the given number on a Telebit T1600 modem.
  1399. t3000-dial    Dials the given number on a Telebit T3000 modem.
  1400. wb-dial        Dials the given number on a Telebit WorldBlazer modem.
  1401. ppp-login    Logs into a remote system directly.  The first argument
  1402.         is a login, and the second argument is the password.
  1403.         This assumes the login shell on the remote system is "dplogin",
  1404.         and performs simple synchronization with that program.
  1405.  
  1406. You may note that the t3000 and Worlblazer scripts are the same since we use
  1407. V.32bis in both cases.  For PEP usage, the WorldBlazer script will
  1408. need modified to handle additional CONNECT messages.
  1409.  
  1410. 5.3.1 abort
  1411.  
  1412. The "abort" command terminates the script with a failure code returned.
  1413. Reading the script past the end of file is equivalent to the "abort" command.
  1414.  
  1415. 5.3.2 go
  1416.  
  1417. The "go" command indicates success.  For a dial script, success means
  1418. that the call went through using the specific modem.  For a login script,
  1419. success means that PPP is started on the remote computer.
  1420.  
  1421. 5.3.3 log "text"
  1422.  
  1423. This writes the given string to the log file (${DPLOG_DIR}/dp.log).
  1424.  
  1425. 5.3.4 mark
  1426.  
  1427. As incoming bytes are received, they are saved in a buffer for possible later
  1428. use by "replay".  The mark command indicates the beginning of where to start
  1429. saving characters.
  1430.  
  1431. 5.3.5 replay
  1432.  
  1433. Characters in the incoming buffer are replayed as if they are being received
  1434. again.  This replay starts at the most recent mark command.
  1435.  
  1436. 5.3.6 recv "text" [ "text" ... ] timeout
  1437.  
  1438. The recv command is used to examine the incoming characters (which can be
  1439. actual new characters, or older ones after a replay command.  The command
  1440. succeeds when a substring of the incoming characters matches one of the
  1441. "text" patterns given.  If the match has not succeeded in "timeout" seconds,
  1442. the "recv" command returns failure.  However, if the "recv" command is in
  1443. a "select block", control is passed to the next alternative.
  1444.  
  1445. 5.3.7 use script [ "parameter" ... ]
  1446.  
  1447. The use command executes another script file and returns success or failure
  1448. depending on the execution of the named script.
  1449.  
  1450. 5.3.8 xmit "text"
  1451.  
  1452. This sends the indicated text to the remote system.  A \x in the string
  1453. will delay 1 second, and a \# will send a break.
  1454. Also, the string $1 will be replaced by the first argument to the script,
  1455. and so on.  The arguments are given in the dp-conf file or as arguments
  1456. the the "use" command.
  1457.  
  1458. 5.3.9 Select Blocks
  1459.  
  1460. Select blocks allow you to specify alternatives on failure of specific
  1461. "recv" commands.
  1462.  
  1463. The format is as follows:
  1464.  
  1465.     {
  1466.     alternate
  1467.         commands...
  1468.     alternate
  1469.         commands...
  1470.     }
  1471.  
  1472. The "{", "}", and "alternate" keywords are commands and must be on separate
  1473. lines.  If a "recv" command fails, then control is passed to the next
  1474. alternate.  If all alternatives fail, then the select block returns a
  1475. failure, and is equivalent to an "abort".
  1476.  
  1477. 6.  Routing
  1478.  
  1479. There are two ways, in general, that you will connect systems
  1480. together with dp. The first is a single machine (typically at home)
  1481. to a network of systems (the office network or maybe the Internet)
  1482. and second to connect two networks (two sites for example, or an
  1483. office network to the Internet).
  1484.  
  1485. In either case, the networking software has to know how to get to the
  1486. "other" systems. This is done in the kernel by routing tables. There
  1487. is at least one route to each interface, but the administrator (you)
  1488. can add more.
  1489.  
  1490. 6.1 Static Routing
  1491.  
  1492. Where there is a single machine and a remote network or two
  1493. reasonably stable networks which are under your administrative
  1494. control, then the simplest way of setting things up is to use static
  1495. routes.
  1496.  
  1497. Again, in the Unix way there is always more than one way of doing
  1498. things, and this is true for installing route into the kernel. 
  1499.  
  1500. 6.1.1 "route"
  1501.  
  1502. The most direct way to install a new route is the use the route(8)
  1503. command. "route" will allow you, as superuser, to add and delete
  1504. routes in the kernel. There are three (really two) types of route:
  1505.  
  1506. *    Route to a host. This type of route effectively says: you can get
  1507. to this host via this interface.
  1508.  
  1509. *    Route to a network. This type says there is a network over there,
  1510. past that interface on the left :-)
  1511.  
  1512. *    The default route. The is a special route that is used as a catch
  1513. all. It is most useful for a single host (home) connecting to
  1514. everything else and tells the networking software to route everything
  1515. down a single line if the is no other explicit route for it.
  1516.  
  1517. As an example, let's say that a home system is connected to a work system
  1518. via a PPP link.  "home.com" has the PPP interface of 192.220.10.1
  1519. "work.com" has the PPP interface 192.220.10.2 and the ethernet interface
  1520. 192.220.11.18.  In order to another machine on the work ethernet to get to
  1521. the home system, it would need the command
  1522.     
  1523.     /usr/etc/route add 192.220.10.1 192.220.11.18 1
  1524.  
  1525. In order for the home system to reach other hosts on the work ethernet,
  1526. it would need the command:
  1527.  
  1528.     /usr/etc/route add 192.220.11.0 192.220.10.2 1
  1529.  
  1530. Assume now that the ethernet is connected to other networks or the Internet.
  1531. Then, the best command for home.com would be:
  1532.  
  1533.     /usr/etc/route add default 192.220.10.2 1
  1534.  
  1535. This would route all remote packets through the PPP interface.
  1536.  
  1537. 6.1.2 "/etc/gateways"
  1538.  
  1539. The other method is to create a file called "/etc/gateways" that
  1540. lists static route available at boot time (more correctly when the
  1541. routing daemon is started).
  1542.  
  1543. This file is read when "in.routed" is started in "/etc/rc.local".
  1544. For further information, see the routed(8c) manual page.
  1545.  
  1546. 6.2 Dynamic Routing
  1547.  
  1548. In the case where two networks are connected, and these may have
  1549. further connections added to them or taken away,  then there must be
  1550. a way for the routing information to be updated at regular intervals
  1551. so that packets can get to their intended destinations.
  1552.  
  1553. 6.2.1 Routed
  1554.  
  1555. Routed(8c) has been used extensively for adapting routes to changing network
  1556. connectivity.  It will work in this case of PPP links.  Routed works by sending
  1557. RIP packets (Routing Information Protocol) on every interface every 30 seconds.
  1558. Clearly, if we wish to disconnect the phone when our interface is not in use,
  1559. this will cause problems.  For this reason, routed is probably not the best
  1560. choice for routing on hosts with dialup PPP interfaces, unless the intent
  1561. is to keep the phones connected all the time.
  1562.  
  1563. 6.2.1 Gated
  1564.  
  1565. Gated is a program that knows about routing via several protocols.
  1566. It can handle RIP (routed) packets, as well as other protocols such
  1567. as EGP (External Gateway Protocol) and GGP (Gateway to Gateway Protocol).
  1568. It also can be used to consider certain routes as "static" and to be always
  1569. available.  These routes can then be advertised using any of the available
  1570. routing protocols, including RIP.
  1571.  
  1572. If you have RIP based routing, then gated can be easily set up on your
  1573. hub machine up to use static routing for the PPP links and use RIP for
  1574. the other (ethernet?) networks.
  1575.  
  1576. Here is an example gated configuration file for our campus hub that talks
  1577. to 6 remote systems, each with a local ethernet at the other end:
  1578.  
  1579.     #
  1580.     #    Config file gated on phoenix.acn.purdue.edu
  1581.     #
  1582.     traceoptions internal external route rip update ;
  1583.     #tracefile "/tmp/gated.trace" ;
  1584.  
  1585.     interface all passive ;        # don't time out my interfaces!
  1586.  
  1587.     #
  1588.     # Do rip except on the PPP interfaces
  1589.     #
  1590.     rip supplier {
  1591.     interface dp0 noripout noripin ;
  1592.     interface dp1 noripout noripin ;
  1593.     interface dp2 noripout noripin ;
  1594.     interface dp3 noripout noripin ;
  1595.     interface dp4 noripout noripin ;
  1596.     interface dp5 noripout noripin ;
  1597.     } ;
  1598.  
  1599.     #
  1600.     # Set up static routes to remote ethernets at the end of PPP links
  1601.     # We are advertising ourself as a gateway to the subnetwork assigned
  1602.     # to the PPP links.  For each remote ethernet, the remote end of a PPP
  1603.     # link is being advertised as a gateway.
  1604.     #
  1605.     static {
  1606.     128.46.177.0 gateway 128.46.157.167 ;    # PPP Links
  1607.     128.46.34.0  gateway 128.46.177.34 ;    # Remote ethernet
  1608.     128.46.181.0 gateway 128.46.177.43 ;    # Remote ethernet
  1609.     128.46.176.0 gateway 128.46.177.49 ;    # Remote ethernet
  1610.     128.46.182.0 gateway 128.46.177.50 ;    # Remote ethernet
  1611.     128.46.84.0  gateway 128.46.177.84 ;    # Remote ethernet
  1612.     } ;
  1613.  
  1614.     #
  1615.     # Send out all sorts of interesting information in RIP packets
  1616.     #
  1617.     propagate proto rip {
  1618.     #
  1619.     # Propagate anything learned via RIP
  1620.     #
  1621.     proto rip ;
  1622.     #
  1623.     # Propagate static routes to county ethernets
  1624.     # Technically, the metric for remote ethernets should be 2,
  1625.     # but 1 works better in this scenario since there are no alternate
  1626.     # routes anyway, especially direct routes.
  1627.     #
  1628.     proto static metric 1 ;
  1629.     #
  1630.     # Propagate routes to all connected interfaces
  1631.     #
  1632.     # proto direct metric 1 ;
  1633.     } ;
  1634.  
  1635.     #
  1636.     # We don't have SNMP configured in
  1637.     #
  1638.     #snmp no ;
  1639.  
  1640. We are using gated 2.1 and it is available via anonymous ftp from
  1641. gated.cornell.edu in the file "pub/gated/gated/gated.tar.Z".
  1642. It works quite well in our configuration.
  1643.  
  1644. 7. Tuning
  1645.  
  1646. You need to set up your "${DPCONF_DIR}/conf" file and any script
  1647. and access files for what makes sense in your environment.  The primary
  1648. tuning comes in getting your dialing scripts to work, selecting appropriate
  1649. timeouts in your access file, and monitoring what happens.
  1650.  
  1651. The file ${DPLOG_DIR}/call.log can be used to give you a one line
  1652. summary of each successful call.  The file ${DPLOG_DIR}/dp.log can be used
  1653. to show you a blow by blow description of calls in progress.  The amount
  1654. of logging can be increased by invoking dpd with "-d N" where N can be anywhere
  1655. from 0 for minimal logging to 3 for verbose logging.  In addition, the log
  1656. level can be set for individual systems in the configuration file.
  1657.  
  1658. If you encounter problems with the kernel modules, you can turn on very
  1659. verbose debugging output by setting the following kernel variables:
  1660.  
  1661. dpif streams module        (dp_if.o)
  1662.     dp_if_debug            General info
  1663.     dp_ftimo_debug        Fast timeout mechanism
  1664.     dp_active_debug        TCP connection status
  1665.  
  1666. pppdial streams module        (dp_if.o)
  1667.     ppp_dial_debug        General info
  1668.  
  1669. pppasync streams module        (ppp_async.o)
  1670.     ppp_async_debug        General info
  1671.     ppp_async_input_debug    input packet dump of N bytes
  1672.  
  1673. These variables are all "int" variables and should be set to 0 or 1, to have
  1674. the reporting off or on, respectively.  The ppp_async_input_debug variable
  1675. can be given a value greater than 1 to indicate the number of bytes printed in
  1676. a packet trace.
  1677.  
  1678. When running adb on the kernel, you must be sure to specify the correct
  1679. object file.  If the modules are compiled into the kernel, the object
  1680. module is always "/vmunix".  Otherwise, the object module is the
  1681. specific file ${DPMODULES_DIR}/dp_if.o or ${DPMODULES_DIR}/ppp_async.o
  1682. For this example, we will use /vmunix, but please use the appropriate
  1683. file depending on your configuration.
  1684.  
  1685. Here is a typical adb session:
  1686.  
  1687.     # adb -w -k /vmunix /dev/mem
  1688.     physmem fe9
  1689.     ppp_async_input_debug/X
  1690.     _ppp_async_input_debug:    0
  1691.     /W0t32
  1692.     _ppp_async_input_debug:    0x0    =    0x20
  1693.     $q
  1694.     #
  1695.  
  1696. In order to set a variable to remain in effect after the next reboot,
  1697. you must use ? instead of /.
  1698.  
  1699. 7.1 Broadcast programs
  1700.  
  1701. Some programs broadcast information on a regular basis to all connected
  1702. interfaces.  If a program is found to generate frequent output on PPP
  1703. interfaces, it should be reconfigured, modified, or just not run at all,
  1704. depending on the circumstances.
  1705.  
  1706. 7.1.1 rwhod
  1707.  
  1708. A common example of a talkative program is rwhod.  If you must run rwhod,
  1709. it should be modified to ignore PPP links.  Context diffs for rwhod are
  1710. available on phoenix.acn.purdue.edu in pub/rwhod.diffs.Z.  Once applying
  1711. these diffs to rwhod sources, you should be able to run rwhod with the
  1712. "-p" flag to suppress all output on Point to Point interfaces.
  1713.  
  1714. 7.2 Nameserver
  1715.  
  1716. If you are on the Internet, you are basically mandated to use DNS.
  1717. If you are relying solely on DNS (no NIS or host tables), you should
  1718. set up nameservers at the remote sites. Care should be taken in the
  1719. configuration of the nameservers.  There are at least a couple of ways
  1720. that you can set things up.
  1721.  
  1722. 7.2.1 Secondary nameservers 
  1723.  
  1724. You can set up secondary nameservers on each of the remote sites.
  1725. They can zone load your organization wide zones on a regular basis.
  1726. Please note that zones have a refresh time at which point a connection
  1727. will be made to check for updates.  This can vary, but it may be 12 hours
  1728. or so.  This interval is specified in the zone file on the primary nameserver.
  1729. At this interval, the remote secondary nameserver will contact the primary
  1730. nameserver (generating a call in our case).  It will verify that it has
  1731. the most recent version of each zone of interest.
  1732.  
  1733. 7.2.2 Primary nameservers
  1734.  
  1735. For remote sites that are placing toll calls, a refresh interval of 12
  1736. hours would result in 2 extra toll calls per day.  This may be a problem.
  1737. If so, consider making the remote system a primary nameserver.  When the
  1738. central nameserver file is updated, it needs distributed to all remote
  1739. primary nameservers, but this may be manageable compared to all the long
  1740. distance toll charges of the more automatic scheme employed by the secondary
  1741. nameservers.
  1742.  
  1743. In general the remote primary servers should not be listed in the
  1744. nameserver data contained in the zone data.  Otherwise, distant Internet hosts
  1745. may try to use them for information about the zone, generating unnecessary
  1746. traffic.  They should exist as primary nameservers, but not be advertised
  1747. as such.
  1748.  
  1749. 8. Supporting Higher Baud Rates
  1750.  
  1751. This software includes support for baud rates greater than 38400 in
  1752. a few special circumstances.
  1753.  
  1754. 8.1 Sun zs Ports
  1755.  
  1756. The zs ports on the Suns are capable of going faster than 38400. The
  1757. divisor in the hardware timer chip is set so that
  1758.  
  1759.     baud_rate = 4915200 / ((divisor + 2) * 2 * 16)
  1760.  
  1761. Here are some example divisors
  1762.  
  1763.       Divisor    Baud Rate
  1764.     510       300
  1765.     62      2400
  1766.     14      9600
  1767.     6     19200
  1768.     2     38400
  1769.     1     51200
  1770.     0     76800
  1771.  
  1772. So, there is a little room for going faster.  Unfortunately, there is
  1773. not a 57600 baud rate available.  However, some modems can handle 76800
  1774. (such as the Telebit Worldblazer), and that can be set just as easily.
  1775. By default, the "-DFASTSZ" flag is set in the Makefile.hw file.
  1776. So, code will be compiled into the program that will recognize
  1777. 76800 as a valid baud rate.  Since all 16 table entries are used up,
  1778. we must replace one of the unused baud rate divisors with a 0 divisor.
  1779. I have never seen anyone use 50 baud devices.  The code that recognizes
  1780. 76800, uses the table entry for 50 baud.
  1781.  
  1782. In order to modify the kernel table for the zs divisors, use the
  1783. following adb commands:
  1784.  
  1785.  
  1786.     # adb -w -k /vmunix /dev/mem
  1787.     zs_speeds/16d
  1788.     _zs_speeds:
  1789.     _zs_speeds:     0       3070    2046    1394    1140    1022    766     510
  1790.             254     126     83      62      30      14      6       2
  1791.     zs_speeds+2/w0
  1792.     _zs_speeds+2:   0xbfe   =       0x0
  1793.     zs_speeds/16d
  1794.     _zs_speeds:
  1795.     _zs_speeds:     0       0       2046    1394    1140    1022    766     510
  1796.             254     126     83      62      30      14      6       2
  1797.  
  1798. This modifies the in-memory copy only.  To modify /vmunix, use ?w0.
  1799. To modify for all future kernels, modify /usr/sys/`arch`/OBJ/zs_async.o
  1800.  
  1801. 8.2 Central Data SCSIterminal Server Ports
  1802.  
  1803. We use SCSI ports from Central Data of Champaign, IL, USA (1-217-359-8010).
  1804. We have used the ST-1008 (8 port) and ST-1000 (16 port) models.
  1805. They are capable of all the normal baud rates, plus 57,600 baud.
  1806. Many V.32bis modems support 57600 baud, which is the theoretical baud
  1807. rate maximum when using V.32bis + V.42 + V.42bis compression.
  1808.  
  1809. To enable support for this device, edit the "Makefile.hw" file, and add
  1810. the directive "-DSTS" to the HWSUPPORT definition.  This is not defined
  1811. by default, since using this software requires an include file that is
  1812. not normally part of SunOS.
  1813.  
  1814. The normal terminal driver designates 4 bits for speed, and all 16 possible
  1815. speeds are already defined.  So, Central Data has developed an ioctl which
  1816. shifts the definition of all the baud rates down by one place in the table,
  1817. making room for a new higher baud rate (57,600).  This is extremely kludgy,
  1818. but actually works quite well for us.  You can issue this ioctl once,
  1819. then use B38400.  This is simpler in that it does not require code changes.
  1820. However, you can get into a situation where the baud extension factor
  1821. is set incorrectly, and nothing works right.  Instead, we have modified
  1822. the code that handles baud rate in all the software to recognize 57,600
  1823. and take appropriate action.  This has been done in the dpd program.
  1824. Using "-DSTS" in the Makefile will enable this support.  If you want
  1825. to run getty on this port, you will need to modify getty or provide
  1826. a wrapper program that will set the baud rate extension factor correctly.
  1827. You may also want to update tip or cu, as necessary.
  1828.  
  1829. Some versions of the driver will output an annoying message on the
  1830. console anytime the baud extension factor is set.  If you have this
  1831. driver, then you can turn that off with the following adb commands:
  1832.  
  1833.     # adb -w -k /vmunix /dev/mem
  1834.     physmem fe9
  1835.     ctioctl+260/i
  1836.     _ctioctl+0x260: call    _printf
  1837.     /W1000000
  1838.     _ctioctl+0x260:     0x0    =    0x1000000
  1839.     /i
  1840.     _ctioctl+0x260: nop
  1841.     $q
  1842.     #
  1843.  
  1844. If the module is compiled into the kernel, you can do the same
  1845. adb commands with a ? instead of / and make the changes in the
  1846. compiled kernel.  For a dynamically loaded driver, this will not
  1847. work since the address of printf does not get set until the driver
  1848. is loaded.  Relocating the nop instruction will not produce the
  1849. desired effect.
  1850.  
  1851. 9. Future work
  1852.  
  1853. A few areas are slated for future work as time permits.
  1854.  
  1855. We will continue to track the Point to Point Protocol as it is updated
  1856. and newer versions are made available
  1857.  
  1858. With slow links, there are some problems with the combination of
  1859. bursty interactive traffic and large batch file transfer traffic.
  1860. A future release will implement Type of Service (TOS) priority queuing
  1861. to give priority to interactive packets.  This should help interactive
  1862. response on heavily loaded links.
  1863.  
  1864. We would like to add some administrative tools that can give a better
  1865. picture of the traffic patterns over periods of time.  For instance,
  1866. it would be useful to have a report showing how many calls were placed
  1867. for what protocol, sorted by number of calls, for a given month.
  1868.  
  1869. Peter Galbavy is now working on modifications to do synchronous 64 Kbps
  1870. with the SPARCstation on board serial port.
  1871.  
  1872. Further updates to this document will be made as we get feedback from
  1873. people using the software.
  1874.  
  1875. Support for other platforms will be integrated as interested parties provide
  1876. the ports.
  1877.  
  1878. Support for Solaris 2.[12] will come as it becomes generally available.
  1879.  
  1880. 9. Credits
  1881.  
  1882. The bulk of the work has been done at Purdue University by Kirk Smith
  1883. (ks@acn.purdue.edu) and has been supported by the Purdue Agricultural
  1884. Computer Network.  The Purdue ACN is responsible for networking 97
  1885. remote computers to the campus internet.  Right now, 11 remote sites are
  1886. in operation and more will come on line as Sun equipment is purchased.
  1887.  
  1888. Peter Galbavy of Micromuse Ltd. (Peter.Galbavy@micromuse.co.uk) has provided
  1889. invaluable help in several areas.  Among these, were the loadable module
  1890. support, integration of newer PPP revisions, significant work on this document,
  1891. and much testing and several bug fixes.
  1892.